<template>
  <div class="test-border" style="width: 100%;height: 100%">
    这是更新界面
  </div>
</template>

<script>
export default {
  name: "update",
  mounted() {
    window.addEventListener('beforeunload', this.updateHandler)

  },
  destroyed() {
    window.removeEventListener('beforeunload', this.updateHandler)
  },
  methods: {
    updateHandler() {
      console.log(123456)
    },
  }
}
</script>

<style scoped></style>
